Adds a Polymer 3 element template to init.#115
Conversation
…ecked by depcheck.
|
This still doesn't install. |
rictic
left a comment
There was a problem hiding this comment.
Nice!
It should have a test IMO. Let's add a test of this template in test/integration/integration_test
dee0594 to
f9de6b3
Compare
|
I added an integration test, there were a handful of problems though:
|
| // compiled out? | ||
| async prompting() { | ||
| return super.prompting(); | ||
| } |
There was a problem hiding this comment.
Can you double check that this doesn't work when this isn't here? I looked at the JS that's produced, and we're producing ES6 here. I can't see any reason why this code would do anything at all.
There was a problem hiding this comment.
It seems like async-await is being compiled out. I'm betting it has something to do with that.
There was a problem hiding this comment.
Also, yes, the parent class' prompting function isn't called if this isn't here. I can't figure out where yeoman-generator calls it though and I'm not sure how it gets called due to the async-await thing.
There was a problem hiding this comment.
Hmm, telling TypeScript to target ES2017 still has this problem.
There was a problem hiding this comment.
Here's the problem: https://github.com/yeoman/generator/blob/v1.0.1/lib/index.js#L382
Yeoman only checks the object's prototype's own properties, so I think I have to have something like this in here.
There was a problem hiding this comment.
I've added pass-through functions for all of the other methods as well.
There was a problem hiding this comment.
Oh hey, you found it too. I just filed yeoman/generator#1065
| // packages. | ||
| await exec('npm install', {cwd: dir}); | ||
|
|
||
| // TODO(bicknellr): Add this back in when `polymer lint` has a Polymer 3 |
There was a problem hiding this comment.
Let's use test urls instead of usernames for TODOs. #130 for this one
| // await runCommand(binPath, ['lint'], {cwd: dir}); | ||
|
|
||
| // TODO(bicknellr): Remove the `--module-resolution=node` argument once | ||
| // `polymer test` passes them in correctly |
| await runGenerator(createElementGenerator('polymer-3.x')) | ||
| .withPrompts({name: 'my-element'}) // Mock the prompt answers | ||
| .toPromise(); | ||
| // TODO(bicknellr): Use `polymer install` once it supports installing npm |
| class Polymer3ElementGenerator extends ElementGenerator { | ||
| // TODO(bicknellr): Why doesn't this inherit properly? Because `async` is | ||
| // compiled out? | ||
| // This is not a no-op: Yeoman only checks the object's prototype's own |
There was a problem hiding this comment.
Let's add a mention of yeoman/generator#1065 here with these not a no-op comments.
|
One of the tests timed out; I'm going to restart that Travis build. |
* Update dependencies. * Update vscode-languageserver as well. * More type safe ClientCapabilities. * Standardize import style of vscode-uri
No description provided.